package class4;

import java.io.*;

public class demo3 {
    public static void main(String[] args) throws IOException {
      FileWriter writer =new FileWriter("writer.txt",true);
      FileReader reader=new FileReader("test.txt");
        BufferedWriter bufferedWriter=new BufferedWriter(writer);
        BufferedReader bufferedReader=new BufferedReader(reader);
     String str;
     while ((str=bufferedReader.readLine())!=null){
         bufferedWriter.write(str);
         bufferedWriter.newLine();
     }
        bufferedWriter.close();
     bufferedReader.close();


    }
}
